<#include "/layout/layout.ftl">
<#import "/layout/macro.ftl" as macro>
<#import "/layout/select.ftl" as my/>
<#assign css>
<#--此ftl中用到的css-->
</#assign>
<#assign js>
<#--此ftl中用到的js-->
<script>
	$(".btn-submit").click(function () {
		// 校验表单合法
		var bootstrapValidator = $(".form-edit").data('bootstrapValidator');
		bootstrapValidator.validate();
		if(bootstrapValidator.isValid()){
			$.ajax({
				type: "POST",
				url: "/order/edit",
				data: $(".form-edit").serialize(),
				dataType: "JSON",
				success: function(res){
					layer.msg(res.message, {time: 2000
					}, function(){
						location.href="/order/index";
					});
				}
			});
		}else{
			return false;
		}
	});

	$('.form-edit').bootstrapValidator({
		message: '请输入有效值',
		feedbackIcons: {
			valid: 'glyphicon glyphicon-ok',
			invalid: 'glyphicon glyphicon-remove',
			validating: 'glyphicon glyphicon-refresh'
		}
	});

</script>
</#assign>
<@layout title="编辑" active="order">
<!-- Content Header (Page header) -->
<section class="content-header">
	<h1>
		<#if isAdd>
            新增
        <#else>
            编辑
        </#if>
		<small>订单详细信息</small>
	</h1>
	<ol class="breadcrumb">
		<li><a href="/"><i class="fa fa-home"></i> 管理后台</a></li>
		<li><a href="#"><i class="fa fa-list-ul"></i> 订单管理</a></li>
		<li class="active"><i class="fa fa-edit"></i>
		    <#if isAdd>
                新增
            <#else>
                编辑
            </#if>
		</li>
	</ol>
</section>
<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<!-- Default box -->
			<div class="box  box-primary">
				<form class="form-horizontal form-edit" method="post" action="order/edit">
					<div class="box-body">
						<input type="hidden" id="id" name="id" value="${order.id!}">
						<input type="hidden" id="isAdd" name="isAdd" value="${isAdd?string('true','false')}">
						<div class="form-group">
							<label class="col-sm-2 control-label">订单号：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入订单号" id="orderNo" name="orderNo" class="form-control" type="text" value="${order.orderNo!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">总金额：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入总金额" id="amount" name="amount" class="form-control" type="text" value="${order.amount!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">订单类型</label>
							<div class="col-sm-10">
								<input required placeholder="请输入订单类型 1-跑腿帮我送 2-跑腿帮我取 3-随意购 4-万能帮办 5-合作商家" id="type" name="type" class="form-control" type="text" value="${order.type!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">取货地址：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入取货地址" id="fromAddressId" name="fromAddressId" class="form-control" type="text" value="${order.fromAddressId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">送货地址：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入送货地址" id="toAddressId" name="toAddressId" class="form-control" type="text" value="${order.toAddressId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">支付时间：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入支付时间" id="payAt" name="payAt" class="form-control" type="text" value="${order.payAt!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">用户id：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入用户id" id="userId" name="userId" class="form-control" type="text" value="${order.userId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">删除状态：</label>
							<div class="col-sm-10">
								<@my.select id="sex" datas=getDict('DATA_STATUS')  value="${order.deleteState!}" defaultValue="请选择"/>
								<#--<input required placeholder="请输入删除状态 1-正常 2-删除" id="deleteState" name="deleteState" class="form-control" type="text" value="${order.deleteState!}" >-->
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">取货送货时间：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入取货送货时间" id="taskTime" name="taskTime" class="form-control" type="text" value="${order.taskTime!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">类型id：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入类型id" id="categoryId" name="categoryId" class="form-control" type="text" value="${order.categoryId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">类型名称：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入类型名称" id="categoryName" name="categoryName" class="form-control" type="text" value="${order.categoryName!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">重量：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入重量 单位公斤" id="weight" name="weight" class="form-control" type="text" value="${order.weight!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">代收款：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入代收款" id="collectionAmount" name="collectionAmount" class="form-control" type="text" value="${order.collectionAmount!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">代收款手续费：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入代收款手续费" id="collectionFee" name="collectionFee" class="form-control" type="text" value="${order.collectionFee!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">服务费：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入服务费" id="serviceFee" name="serviceFee" class="form-control" type="text" value="${order.serviceFee!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">保价金额：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入保价金额" id="insurance" name="insurance" class="form-control" type="text" value="${order.insurance!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">保价手续费：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入保价手续费" id="insuranceFee" name="insuranceFee" class="form-control" type="text" value="${order.insuranceFee!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">保价赔付金额：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入保价赔付金额" id="insurancePayment" name="insurancePayment" class="form-control" type="text" value="${order.insurancePayment!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">验证码：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入验证码" id="verifyCode" name="verifyCode" class="form-control" type="text" value="${order.verifyCode!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">距离：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入距离 单位公里" id="distance" name="distance" class="form-control" type="text" value="${order.distance!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">优惠券id：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入优惠券id" id="couponId" name="couponId" class="form-control" type="text" value="${order.couponId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">其他费用：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入其他费用 如深夜服务加价" id="otherFee" name="otherFee" class="form-control" type="text" value="${order.otherFee!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">其他费用说明：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入其他费用说明" id="otherFeeInstruction" name="otherFeeInstruction" class="form-control" type="text" value="${order.otherFeeInstruction!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">支付类型：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入支付类型 1-微信支付 2-支付宝支付" id="payType" name="payType" class="form-control" type="text" value="${order.payType!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">预计送达时间：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入预计送达时间" id="forecastDeliveryTime" name="forecastDeliveryTime" class="form-control" type="text" value="${order.forecastDeliveryTime!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">实际送达时间：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入实际送达时间" id="deliveryTime" name="deliveryTime" class="form-control" type="text" value="${order.deliveryTime!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">商品费用：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入商品费用（随意购时生效）" id="goodsAmount" name="goodsAmount" class="form-control" type="text" value="${order.goodsAmount!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">万能帮办图片：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入万能帮办图片" id="images" name="images" class="form-control" type="text" value="${order.images!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">师傅id：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入师傅id" id="masterId" name="masterId" class="form-control" type="text" value="${order.masterId!}" >
							</div>
						</div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注：</label>
                            <div class="col-sm-10">
                                <textarea  placeholder="请输入内容" id="remark" name="remark" class="form-control" >${order.remark!}</textarea>
                            </div>
                        </div>
					</div>

					<div class="box-footer">
						<button type="button" class="btn btn-default btn-back">返回</button>
						<button type="button" class="btn btn-info pull-right btn-submit">提交</button>
					</div>

				</form>
			</div>
			<!-- /.box -->
		</div>
	</div>
</section>
<!-- /.content -->
</@layout>
